home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d26
/
extol30.arc
/
EXTOL.DOC
< prev
next >
Wrap
Text File
|
1987-10-31
|
28KB
|
847 lines
PC-EXTOL
Version 3.0
by
Michael C. Taylor
129 Country Club Rd.
Pine Hill, NJ 08021
Your diskette should contain the following files:
EXTOL.EXE - EXTOL PROGRAM
EXTOL.DOC - EXTOL DOCUMENTATION
GENDER.EXT - SAMPLE USE OF DRILL COMMAND
ALICE.EXT - SAMPLE QUIZ ON ALICE IN WONDERLAND
BEATLES.EXT - BEATLES TRIVIA QUIZ
GRAPH.EXT - SAMPLE EXTOL GRAPHICS PROGRAM (NEEDS CGA)
TEXT.EXT - SAMPLE EXTOL PROGRAM USING "TEXTFILE"
SCRGRAB.COM - MEMORY RESIDENT "SCREEN-GRABBER" (SEE SCRGRAB.DOC)
EXTOL.PIC - File used by GRAPH.EXT
Introduction
EXTOL is a programming language designed for Computer-Aided
Instruction (CAI) which is particularly well-suited for
non-mathematical domains. EXTOL was originally developed at Essex
University in England, and the PC version is a full implementation of
EXTOL along with several enhancements.
PC-EXTOL is distributed as shareware. You are encouraged to
copy and distribute copies of the program. You are prohibited from
altering the program code and documentation in any way.
PC-EXTOL is the result of many months of programming, debugging
and documenting. If you find the programs useful, please register
your copy by sending a contribution ($25 is suggested) to:
Michael C. Taylor
129 Country Club Rd
Pine Hill, NJ 08021
In exchange for registering your copy, you will be sent the
next version of PC-EXTOL free of charge and will be notified of
any future enhancements by mail (These will also be provided to
you free of charge if you send me a diskette by mail).
PC-EXTOL is a very useful language for CAI. I would
greatly appreciate any comments, suggestions or questions you
may have about the system. I can be reached on the following
BBS's
The Pinelands BBS - (609) 354-9259
Computer Connection (609) 784-9404
Compu-Data (609) 232-1245
or on Compuserve (user id 72467,2723).
EXTOL RELEASE HISTORY
Release Description
------- -----------
1.0 Initial release of EXTOL - Based on
University of Essex Version.
2.0 Added If-then-else logic to EXTOL making
program code much more succinct and logical
2.1 Added .textfile command to allow large ASCII
Files to be Read in to EXTOL at run time - thus
saving memory.
2.11 Fixed bugs in release 2.1 and expanded maximum
EXTOL program size to 500 lines.
3.0 Expanded maximum program size to 2500 lines.
Added graphics commands to EXTOL.
Added .decrement command to EXTOL.
Added several new sample EXTOL files.
Added memory-resident screen saving utility.
Added .position command to EXTOL.
Removed EXRPT program (no longer needed).
EXTOL can now be invoked as:
EXTOL filename.
I. Types of statements in EXTOL
EXTOL statements can be grouped into four main catagories. Each
line could be a text line (to be printed on the screen when the quiz is
run), a comment (which is ignored when the program is run), a command
line, or a label (which is used as a 'landmark' to allow the program to
interrupt the flow of control of the program).
IA. Running EXTOL programs
EXTOL programs may be run in the following ways :
1) EXTOL filename - where filename is the name of the
EXTOL program to be run.
2) EXTOL - if you do not specify a file, you will be
prompted for a filename.
1.1 Text Statements
Text statements in EXTOL are any lines that begin with any
character other than '.', '%', and ':'. Text lines are simply printed
on the terminal at run time. If the text line contains a variable to be
printed (see Variable command), then the value of the variable is
copied into the text line before the line is displayed.
For example:
This is a text line.
This line contains a variable - The correct answer is <answer>.
Often a text line is used immediately before an "accept" command
to ask a question and allow the student to respond. If you want the
students response to be on the same line as the text printed, put a "+"
as the last character of the text line.
For example:
Please enter the answer+
.accept
This code would accept the student's answer on the same line as the
request (The "+" will not show up on the screen when the program is
run).
1.2 Comments
Comments in EXTOL are any lines that begin with a '%'. These lines
are ignored by the program and are included by the programmer only to
make a comment about the program.
For example: %This is a comment.
1.3 Commands
Commands in EXTOL are any lines beginning with a '.'. These lines
perform various functions which will be explained in Chapter 2.
Valid commands in EXTOL are:
.accept
.define
.exact
.end
.exit
.feed
.goto
.if
.else
.enddo
.increment
.decrement
.keyword
.caseon
.caseoff
.mark
.match
.perform
.print
.reset
.response
.clear
.copy
.textfile
.stop
.monitor
.mode
.screenfile
.position
.<
ALL COMMANDS MUST BE ENTERED IN LOWER CASE !!
1.4 Labels
Any EXTOL line beginning with a ':' is considered a label. If
during the program, you wanted to repeat certain lines, the goto
command would need a 'landmark' to go to.
For example:
:again
Enter your name
.accept
.goto.again
The goto command would go to the label named 'again'.
II. Commands in EXTOL
note: all commands in EXTOL must be entered in lower case letters!
2.0 Score counters
With EXTOL, up to 10 counters can be kept during the execution of
the program. These counters can be used to keep track of how many
correct answers the student entered, or how many times the student took
to get the correct answer or many other things. The counters are
numbered 0 to 9 and are used with the following commands:
.increment
.decrement
.goto
.match
.print
.reset
.if
2.1 The accept command
Format : .accept
The accept command allows the person taking the quiz a chance to
enter a response.
For example:
Type in your name.
.accept
The above lines would prompt the user to enter his or her name and
would then wait until the student keyed in his name and pressed the
return key.
2.2 The feed command
Format : .feed(n)
The feed command is used to make the output of the program neater.
The command prints n blank lines on the terminal.
2.3 The clear command
Format : .clear
The clear command simply clears the screen.
2.4 The stop command
Format : .stop
The stop command ends program execution.
2.5 The match command
Format : .match(x,y).val1.val2.etc.
Where : x is the score counter (0-9) to be incremented,
y is the amount to increment score counter x,
and val1,etc. are the values to compare the student's answer
against. NOTE - THE LAST MATCH VALUE MUST BE FOLLOWED BY "."
This command compares the student's response against the list of
possible values. If the response matches one of these values (either
exactly or by keyword see 2.6 - 2.7), the score counter x is increased
by y.
For example:
Did Dante write "Inferno" ?
.accept
.match(2,1).YES.YEAH.TRUE.
In the above program, the student is asked a question. If he responds by
typing YES, YEAH or TRUE, the score counter 2 will be increased by 1. If he
types in anything else, the score counter will be unchanged.
Note that in the above example the answers that the student's response
is to be compared against are all in upper case. If the .caseon command
is used, all answers keyed in by the student are converted into upper
case before they are compared against the values in the .match command.
If the .caseon option is used, all values in the match command must be
entered in upper case (see .caseon command).
2.6 The exact statement
Format : .exact
The exact statement affects the match statement. The exact
statement makes subsequent match statements compare the student's
response letter for letter with the possible answers.
2.7 The keyword statement
Format : .keyword
The keyword statement also affects the match statement. This
statement makes the match statement check to see if any of the possible
correct answers are contained WITHIN the student's response.
For example:
.keyword
.caseon
Who wrote Huckleberry Finn?+
.accept
.match(2,1).TWAIN.CLEMENS.
In this example, keyword matching is in effect. Therefore if the
student were to type:
Huckleberry Finn was written by Samuel Clemens.
The answer would still be correct because the keyword 'CLEMENS' is
contained in his answer.
2.7.1 The caseon command
The caseon command causes any answers keyed in by the student to be
converted to all upper case before being compared with the proper
answers. When using the caseon function, be sure that all answers that
you compare the student's response against, are keyed in upper case in
your program code. For example:
.caseon
Who did Tom fall in love with?
.accept
.match(1,1).POLLY.
2.7.2 The caseoff command
The caseoff command cancels the effects of the caseon command.
2.8 The goto command
Format 1 : .goto.val1
Where : val1 is the name of a label in the program.
This is an unconditional goto to a specific label.
For example :
:name
Type in your name.
.accept
.goto.name
The above example would ask for a name. When the name was entered, the
.goto.name command would goto the label called name and ask for another
name. The above example would repeat indefinitely.
Format 2 : .goto(x).val1.val2.etc.
Where : x is the number (0-9) of a score counter,
val1,val2 etc. are names of labels in the program.
This format can goto more than one destination based on the value
of the score counter.
For example:
Did Tom Sawyer ever go home?
.accept
.exact
.match(1,1).YES.YEAH.TRUE.
.goto(1).incorrect.correct
:incorrect
I'm sorry but he did.
.stop
:correct
That's correct!
.stop
The above example asks asks a question and matches the student's
response exactly against the correct answers (YES,YEAH or TRUE). If a
match is found, score counter number 1 is increased by 1. Then the goto
command looks at that value. If the student was wrong, the value of
counter 1 should be 0 and therefore the program will goto incorrect. If
the student was right, then the value of counter 1 should be 1 and the
program will jump to the correct portion of the program. (NOTE - see
.if command for an easier method of doing this!)
2.8.1 .if, .else, .enddo commands
Format 1 : .if match(n) do
...(extol commands)
.enddo
Where : n is the score counter to be looked at.
If the score counter n contains any value greater than zero, the
commands found between the .if and .enddo will be executed. Otherwise,
these commands will be skipped.
Format 2 : .if match(n,m) do
...(extol commands)
.enddo
Where : n is the score counter to be looked at.
m is the value to compare the score counter against
If the score counter n contains any value greater than OR EQUAL to
value m, the commands found between the .if and .enddo will be executed.
Otherwise, these commands will be skipped.
Format 3 : .if match(n,m) do .if match(n) do
...(extol commands) ...
.else OR .else
...(extol commands) ...
.enddo .enddo
The above variation adds an .else condition to the if phrase. Formats
1 or 2 may have elses within the .if and .enddo . If the .if test is true,
the commands between the .if and .else commands will be executed,
otherwise, the commands between the .else and .enddo will be executed.
If commands may also be nested up to 10 levels. (There can be up to
9 .if levels within one .if level).
For example:
Type the name of Bilbo's sword
.accept
.match(0,1).STING.
.if match(0) do
Very good!
.else
No, it was called "Sting".
.enddo
2.9 The reset statement
Format : .reset(x)
Where : x is the number (0-9) of a score counter.
Often when testing answers for right or wrong, after the test is
performed it is necessary to reset the counter value to zero. The reset
command does just that.
2.10 The increment command
Format : .increment(x,y)
Where : x is the number of a score counter,
y is the amount to increment x by.
The increment command increases the value of a score counter
unconditionally by y.
2.101 The decrement command
Format : .decrement(x,y)
Where : x is the number of a score counter,
y is the amount to decrement x by.
The decrement command decreases the value of a score counter
unconditionally by y.
2.11 The print command
Format : .print(x)
Where : x is the number of a score counter.
This command prints the value of any score counter onto the
screen. If you put a "+" after the print statement, the cursor will
not be positioned on the next line, and any text will be put on
the same line.
2.12 The response command
Format : .response filename
Where : filename is the name of a response file.
A record can be kept of who used the program, when they used it
and the values of all the score counters. This command tells what file
is to be used to keep track of this. A report can be printed out on the
use of the program. (See Appendix II - Printing Reports).
2.13 The mark command
Format : .mark
This command writes the values of all the score counters to the
file specified in the .response statement. THIS COMMAND CAN BE USED
ONLY IF A RESPONSE FILE HAS BEEN SPECIFIED.
2.14 The .< command
Format : .<xxxx>=yyyy
Where : xxxx is the name of any variable,
yyyy is the value to be assigned to xxxx.
Variables are very useful in an EXTOL program especially if drills
are to be used (see 2.15-2.18). Any text statements or the .match
command can use variables. The same variable can be reset to a new
value later in the program.
For example:
.<answer>=yes
Does 2+2=4?
.accept
.match(1,1).<answer>.
.goto(1).wrong.right
:wrong
I'm sorry but the answer was <answer>.
.stop
:right
Very good! The answer was <answer>.
.stop
In the above example the variable 'answer' is assigned a value of
'yes'. The match command compares the student's answer to what 'answer'
contains which is 'yes'. Then if the student was incorrect the program
prints :
I'm sorry but the answer was yes.
If he was correct, the program prints :
Very good! The answer was yes.
2.15 The define command
Format : .define drillname
Where : drillname is the name of the drill.
Drills are used for portions of an EXTOL program that are to be
repeated. The variables in the drill can be assigned new values for
every time the drill is performed. The define command tells the program
that all following lines are part of a drill until an .end command is
encountered. These lines will not be executed unless a .perform command
is encountered. (See Appendix I - Use of Drills)
2.16 The perform command
Format : .perform drillname
Where : drillname is the name of a defined drill.
This command will tell the program to execute a predefined drill
(see 2.15 The define command). When an .exit or an .end command is
encountered in the drill, the program will resume with the line
following the .perform command.
2.17 The exit command
Format : .exit
This command when encountered during a drill tells the program to
quit execution of the drill and resume with the statement following the
.perform command.
2.18 The end command
Format : .end
This command is the last command of a drill section. When
encountered during a drill, it will quit execution of the drill and
resume with the statement following the .perform.
2.19 The copy command
Format : .copy filename
Where : filename is the name of a file to copy.
This command copies the contents of filename into the
EXTOL program.
2.20 The textfile command
Format : .textfile=filename
Where : filename is the name of the file containing the desired text.
This command is very useful if you want the student to be able to read
any ascii file while executing an EXTOL program. When EXTOL encounters
this command, the file will be displayed for the student. The text will be
displayed in pages automatically and the student will have the following
options:
Pressing "N" for the next page of text
Pressing "F" for the first page of text
Pressing "X" to end the text
Another advantage of using this command is that the text lines don't
actually get loaded into memory until they are read thus saving memory.
Perhaps the most useful aspect of this command is that you can encorporate
any ascii files you may already have written into your EXTOL programs
without having to copy them over.
2.21 The monitor command
Format : .monitor=xxxxxx
Where : xxxxxx = "MONO " for monochrome monitors
or xxxxxx = "COLOR" for graphics monitors
The monitor command must be used if you are using the .screenfile
command in your file. If the monitor you are using can display graphics,
you should specify ".monitor=COLOR" otherwise you should specify
".monitor=MONO". This command is not needed if you are not using the
.screenfile command !
2.22 The mode command
Format : .mode=xxxx
Where : xxxx = MEDG for medium resolution graphics
xxxx = HIGR for high resolution graphics
xxxx = TEXT for text mode
This command sets the graphics mode in EXTOL. It is only needed if
you are using the .screenfile command. If the screenfile that you are
displaying in your EXTOL program was created with high resolution
graphics, you would specify ".mode=HIGR". The default mode is TEXT.
Note - This command automatically clears the screen when it sets the
new screen mode.
2.23 The screenfile command
Format : .screenfile=filename
Where : filename is the name of the saved screenfile to be loaded and
displayed by your EXTOL program.
This command loads and displays the screen that was previously saved
into the specified filename. To save a graphics screen you must do one of
the following :
1) using a graphics program that allows you to
"BSAVE" screens, save the screens that you will
want to display in EXTOL.
2) use the provided SCRGRAB program as follows:
a) type SCRGRAB
b) run the program which creates the screens that
you want to save
c) when the screen that you want to save is displayed
on your monitor, press the ALT and F9 keys at the
same time. (See SCRGRAB documentation for more
detail).
2.24 The position command
Format : .position(x,y)
Where : x is the row to positon the cursor at
y is the column to position the cursor at
This command allows you to position the cursor anywhere on the screen
before displaying EXTOL text. Row must be between 1 and 25 and Column
must be between 1 and 80.
Appendix I - Use of Drills
Drills are one of the most powerful features of the Extol language.
Drills allow you to code logic one time and execute the drill several
times within the same program. To use the drill facility, you must
be familiar with the EXTOL commands - .define, .exit, .end, and the
use of variables. An example follows:
%Sample of Drill use in Extol
%This program quizzes students on the gender of
%french nouns. The student keys in M if the noun
%is masculing and F if the noun is feminine.
%The drill will determine whether or not the student
%is correct and keep a count of correct answers
%
%The drill code follows:
.define noundrill
Please enter the gender of the noun, <noun>+
.accept
.reset(1)
.match(1,1).<answer>.
.goto(1).incorrect.correct
:incorrect
Sorry, but the gender of <noun> is <answer>.
.exit
:correct
Very good! The gender of <noun> is <answer>.
.increment(2,1)
.end
%This is the end of the drill code
%Program code follows:
Welcome to the french noun quiz. You will be given
a noun and will be asked to type in the gender of
the noun. Please type in "M" if the noun is masculine
and "F" if the noun is feminine. Good Luck!
%
.caseon
.exact
.<noun>=plume
.<answer>=F
.perform noundrill
.<noun>=fils
.<answer>=M
.perform noundrill
Your final score was+
.print(2)
out of a possible 2.
.stop
The statements between the .define and the .end statement are what
make up the drill called "noundrill". When the program encounters
a .perform command, these lines will be executed. Otherwise the
program skips over this section.
The program statements begin with the .caseon command and continue
for the rest of the program. Notice that the program first sets
the values for <noun> and for <answer> before calling the drill
with the .perform command. The drill portion of the code accepts
the student's answer, compares it against the correct answer and
prints a message telling the student whether he was right or wrong.
This is just a very brief sample of the use of the drill command.
This command is ideal for language drills or any repetitive teaching
method.
Appendix II - Printing Reports
If in an EXTOL program you specified a response file and
wrote a student's scores to it (see .response and .mark commands),
A report may be printed listing all students who ran the program,
when they started and finished and what the score counters contained
when the .mark command was executed. To produce the report enter
the following command from DOS.
A> PRINT filename
or
A> TYPE filename > LPT1